//接收命令行参数,process.argv参数从第三个开始，即process.argv[2]
var arg = process.argv[2];
if((typeof arg) == undefined){
    console.log("please input arg!");
}
if(arg == "--help"){
    console.log("program --help");
}
//若为运算式，做求值处理
var result = eval(arg);
if(!isNaN(parseInt(result))){
    console.log(arg + "=" + result);
}
//执行命令行程序node calc.js